package com.stox.model;

public enum BarValue {

	OPEN, 
	HIGH, 
	LOW,
	CLOSE,
	VOLUME;
	
	public double get(Bar bar) {
		switch(this) {
			case OPEN : return bar.getOpen();
			case HIGH : return bar.getHigh();
			case LOW : return bar.getLow();
			case CLOSE : return bar.getClose();
			case VOLUME : return bar.getVolume();
		}
		return 0;
	}
	
}
